﻿using DAL;
using MD5Hash;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public  class LoginBLL
    {
        public LoginBLL (LoginDAL loginDAL)
        {
            LoginDAL = loginDAL;
        }
        public LoginDAL LoginDAL { get; }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="login"></param>
        /// <returns></returns>
        public int Add(Login login)
        {
            try
            {
               
                return LoginDAL.Add(login);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="phone"></param>
        /// <param name="Pwd"></param>
        /// <returns></returns>
        public int Login(string phone, string Pwd)
        {
            try
            {
                return LoginDAL.Login(phone, Pwd);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        public List<Login> Show()
        {
            return LoginDAL.Show();
        }
    }
}
